package org.example.repository;

import org.example.domain.Post;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface PostRepository extends MongoRepository<Post, String> {
    // 按创建时间倒序查询所有帖子
    List<Post> findAllByOrderByCreateTimeDesc();
}